<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/format/format_class.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/format</a> - format_class.hpp<span style="font-size: 80%;"> (source / <a href="format_class.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // ----------------------------------------------------------------------------</a>
<span class="lineNum">       2 </span>            : //  format_class.hpp :  class interface
<span class="lineNum">       3 </span>            : // ----------------------------------------------------------------------------
<span class="lineNum">       4 </span>            : 
<span class="lineNum">       5 </span>            : //  Copyright Samuel Krempp 2003. Use, modification, and distribution are
<span class="lineNum">       6 </span>            : //  subject to the Boost Software License, Version 1.0. (See accompanying
<span class="lineNum">       7 </span>            : //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       8 </span>            : 
<span class="lineNum">       9 </span>            : //  See http://www.boost.org/libs/format for library home page
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : // ----------------------------------------------------------------------------
<span class="lineNum">      12 </span>            : 
<span class="lineNum">      13 </span>            : #ifndef BOOST_FORMAT_CLASS_HPP
<span class="lineNum">      14 </span>            : #define BOOST_FORMAT_CLASS_HPP
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span>            : 
<span class="lineNum">      17 </span>            : #include &lt;vector&gt;
<span class="lineNum">      18 </span>            : #include &lt;string&gt;
<span class="lineNum">      19 </span>            : 
<span class="lineNum">      20 </span>            : #include &lt;boost/optional.hpp&gt; // to store locale when needed
<span class="lineNum">      21 </span>            : 
<span class="lineNum">      22 </span>            : #include &lt;boost/format/format_fwd.hpp&gt;
<span class="lineNum">      23 </span>            : #include &lt;boost/format/internals_fwd.hpp&gt;
<span class="lineNum">      24 </span>            : #include &lt;boost/format/internals.hpp&gt;
<span class="lineNum">      25 </span>            : #include &lt;boost/format/alt_sstream.hpp&gt;
<span class="lineNum">      26 </span>            : 
<span class="lineNum">      27 </span>            : namespace boost {
<a name="28"><span class="lineNum">      28 </span>            : </a>
<span class="lineNum">      29 </span>            :     template&lt;class Ch, class Tr, class Alloc&gt;
<span class="lineNum">      30 </span><span class="lineNoCov">          0 :     class basic_format </span>
<span class="lineNum">      31 </span>            :     {
<span class="lineNum">      32 </span>            :         typedef typename io::CompatTraits&lt;Tr&gt;::compatible_type compat_traits;  
<span class="lineNum">      33 </span>            :     public:
<span class="lineNum">      34 </span>            :         typedef Ch  CharT;   // borland fails in operator% if we use Ch and Tr directly
<span class="lineNum">      35 </span>            :         typedef std::basic_string&lt;Ch, Tr, Alloc&gt;              string_type;
<span class="lineNum">      36 </span>            :         typedef typename string_type::size_type               size_type;
<span class="lineNum">      37 </span>            :         typedef io::detail::format_item&lt;Ch, Tr, Alloc&gt;        format_item_t;
<span class="lineNum">      38 </span>            :         typedef io::basic_altstringbuf&lt;Ch, Tr, Alloc&gt;         internal_streambuf_t;
<span class="lineNum">      39 </span>            :         
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span>            :         explicit basic_format(const Ch* str=NULL);
<span class="lineNum">      42 </span>            :         explicit basic_format(const string_type&amp; s);
<span class="lineNum">      43 </span>            :         basic_format(const basic_format&amp; x);
<span class="lineNum">      44 </span>            :         basic_format&amp; operator= (const basic_format&amp; x);
<span class="lineNum">      45 </span>            :         void swap(basic_format&amp; x);
<span class="lineNum">      46 </span>            : 
<span class="lineNum">      47 </span>            : #if !defined(BOOST_NO_STD_LOCALE)
<span class="lineNum">      48 </span>            :         explicit basic_format(const Ch* str, const std::locale &amp; loc);
<span class="lineNum">      49 </span>            :         explicit basic_format(const string_type&amp; s, const std::locale &amp; loc);
<span class="lineNum">      50 </span>            : #endif
<span class="lineNum">      51 </span>            :         io::detail::locale_t  getloc() const;
<span class="lineNum">      52 </span>            : 
<span class="lineNum">      53 </span>            :         basic_format&amp; clear();       // empty all converted string buffers (except bound items)
<span class="lineNum">      54 </span>            :         basic_format&amp; clear_binds(); // unbind all bound items, and call clear()
<span class="lineNum">      55 </span>            :         basic_format&amp; parse(const string_type&amp;); // resets buffers and parse a new format string
<span class="lineNum">      56 </span>            : 
<span class="lineNum">      57 </span>            :         // ** formatted result ** //
<span class="lineNum">      58 </span>            :         size_type   size() const;    // sum of the current string pieces sizes
<span class="lineNum">      59 </span>            :         string_type str()  const;    // final string 
<span class="lineNum">      60 </span>            : 
<span class="lineNum">      61 </span>            :         // ** arguments passing ** //
<span class="lineNum">      62 </span>            :         template&lt;class T&gt;  
<span class="lineNum">      63 </span>            :         basic_format&amp;   operator%(const T&amp; x)
<span class="lineNum">      64 </span>            :             { return io::detail::feed&lt;CharT, Tr, Alloc, const T&amp;&gt;(*this,x); }
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span>            : #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
<span class="lineNum">      67 </span>            :         template&lt;class T&gt;  basic_format&amp;   operator%(T&amp; x) 
<span class="lineNum">      68 </span>            :             { return io::detail::feed&lt;CharT, Tr, Alloc, T&amp;&gt;(*this,x); }
<span class="lineNum">      69 </span>            : #endif
<span class="lineNum">      70 </span>            : 
<span class="lineNum">      71 </span>            : #if defined(__GNUC__)
<span class="lineNum">      72 </span>            :         // GCC can't handle anonymous enums without some help
<span class="lineNum">      73 </span>            :         // ** arguments passing ** //
<span class="lineNum">      74 </span>            :         basic_format&amp;   operator%(const int&amp; x)
<span class="lineNum">      75 </span>            :             { return io::detail::feed&lt;CharT, Tr, Alloc, const int&amp;&gt;(*this,x); }
<span class="lineNum">      76 </span>            : 
<span class="lineNum">      77 </span>            : #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
<span class="lineNum">      78 </span>            :         basic_format&amp;   operator%(int&amp; x)
<span class="lineNum">      79 </span>            :             { return io::detail::feed&lt;CharT, Tr, Alloc, int&amp;&gt;(*this,x); }
<span class="lineNum">      80 </span>            : #endif
<span class="lineNum">      81 </span>            : #endif
<span class="lineNum">      82 </span>            : 
<span class="lineNum">      83 </span>            :         // The total number of arguments expected to be passed to the format objectt
<span class="lineNum">      84 </span>            :         int expected_args() const
<span class="lineNum">      85 </span>            :             { return num_args_; }
<span class="lineNum">      86 </span>            :         // The number of arguments currently bound (see bind_arg(..) )
<span class="lineNum">      87 </span>            :         int bound_args() const;
<span class="lineNum">      88 </span>            :         // The number of arguments currently fed to the format object
<span class="lineNum">      89 </span>            :         int fed_args() const;
<span class="lineNum">      90 </span>            :         // The index (1-based) of the current argument (i.e. next to be formatted)
<span class="lineNum">      91 </span>            :         int cur_arg() const;
<span class="lineNum">      92 </span>            :         // The number of arguments still required to be fed
<span class="lineNum">      93 </span>            :         int remaining_args() const; // same as expected_args() - bound_args() - fed_args()
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span>            : 
<span class="lineNum">      96 </span>            :         // ** object modifying **//
<span class="lineNum">      97 </span>            :         template&lt;class T&gt;
<span class="lineNum">      98 </span>            :         basic_format&amp;  bind_arg(int argN, const T&amp; val) 
<span class="lineNum">      99 </span>            :             { return io::detail::bind_arg_body(*this, argN, val); }
<span class="lineNum">     100 </span>            :         basic_format&amp;  clear_bind(int argN);
<span class="lineNum">     101 </span>            :         template&lt;class T&gt; 
<span class="lineNum">     102 </span>            :         basic_format&amp;  modify_item(int itemN, T manipulator) 
<span class="lineNum">     103 </span>            :             { return io::detail::modify_item_body&lt;Ch,Tr, Alloc, T&gt; (*this, itemN, manipulator);}
<span class="lineNum">     104 </span>            : 
<span class="lineNum">     105 </span>            :         // Choosing which errors will throw exceptions :
<span class="lineNum">     106 </span>            :         unsigned char exceptions() const;
<span class="lineNum">     107 </span>            :         unsigned char exceptions(unsigned char newexcept);
<span class="lineNum">     108 </span>            : 
<span class="lineNum">     109 </span>            : #if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )  \
<span class="lineNum">     110 </span>            :     &amp;&amp; !BOOST_WORKAROUND(__BORLANDC__, &lt;= 0x570) \
<span class="lineNum">     111 </span>            :     &amp;&amp; !BOOST_WORKAROUND( _CRAYC, != 0) \
<span class="lineNum">     112 </span>            :     &amp;&amp; !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
<span class="lineNum">     113 </span>            :         // use friend templates and private members only if supported
<span class="lineNum">     114 </span>            : 
<span class="lineNum">     115 </span>            : #ifndef  BOOST_NO_TEMPLATE_STD_STREAM
<span class="lineNum">     116 </span>            :         template&lt;class Ch2, class Tr2, class Alloc2&gt;
<span class="lineNum">     117 </span>            :         friend std::basic_ostream&lt;Ch2, Tr2&gt; &amp; 
<span class="lineNum">     118 </span>            :         operator&lt;&lt;( std::basic_ostream&lt;Ch2, Tr2&gt; &amp; ,
<span class="lineNum">     119 </span>            :                     const basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp; );
<span class="lineNum">     120 </span>            : #else
<span class="lineNum">     121 </span>            :         template&lt;class Ch2, class Tr2, class Alloc2&gt;
<span class="lineNum">     122 </span>            :         friend std::ostream &amp; 
<span class="lineNum">     123 </span>            :         operator&lt;&lt;( std::ostream &amp; ,
<span class="lineNum">     124 </span>            :                     const basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp; );
<span class="lineNum">     125 </span>            : #endif
<span class="lineNum">     126 </span>            : 
<span class="lineNum">     127 </span>            :         template&lt;class Ch2, class Tr2, class Alloc2, class T&gt;  
<span class="lineNum">     128 </span>            :         friend basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp;  
<span class="lineNum">     129 </span>            :         io::detail::feed_impl (basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp;, T);
<span class="lineNum">     130 </span>            : 
<span class="lineNum">     131 </span>            :         template&lt;class Ch2, class Tr2, class Alloc2, class T&gt;  friend   
<span class="lineNum">     132 </span>            :         void io::detail::distribute (basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp;, T);
<span class="lineNum">     133 </span>            :         
<span class="lineNum">     134 </span>            :         template&lt;class Ch2, class Tr2, class Alloc2, class T&gt;  friend
<span class="lineNum">     135 </span>            :         basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp; 
<span class="lineNum">     136 </span>            :         io::detail::modify_item_body (basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp;, int, T);
<span class="lineNum">     137 </span>            :         
<span class="lineNum">     138 </span>            :         template&lt;class Ch2, class Tr2, class Alloc2, class T&gt; friend
<span class="lineNum">     139 </span>            :         basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp;  
<span class="lineNum">     140 </span>            :         io::detail::bind_arg_body (basic_format&lt;Ch2, Tr2, Alloc2&gt;&amp;, int, const T&amp;);
<span class="lineNum">     141 </span>            : 
<span class="lineNum">     142 </span>            :     private:
<span class="lineNum">     143 </span>            : #endif
<span class="lineNum">     144 </span>            :         typedef io::detail::stream_format_state&lt;Ch, Tr&gt;  stream_format_state;
<span class="lineNum">     145 </span>            :         // flag bits, used for style_
<span class="lineNum">     146 </span>            :         enum style_values  { ordered = 1, // set only if all directives are  positional
<span class="lineNum">     147 </span>            :                              special_needs = 4 };     
<span class="lineNum">     148 </span>            : 
<span class="lineNum">     149 </span>            :         void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation
<span class="lineNum">     150 </span>            : 
<span class="lineNum">     151 </span>            :         // member data --------------------------------------------//
<span class="lineNum">     152 </span>            :         std::vector&lt;format_item_t&gt;  items_; // each '%..' directive leads to a format_item
<span class="lineNum">     153 </span>            :         std::vector&lt;bool&gt; bound_; // stores which arguments were bound. size() == 0 || num_args
<span class="lineNum">     154 </span>            : 
<span class="lineNum">     155 </span>            :         int              style_; // style of format-string :  positional or not, etc
<span class="lineNum">     156 </span>            :         int             cur_arg_; // keep track of wich argument is current
<span class="lineNum">     157 </span>            :         int            num_args_; // number of expected arguments
<span class="lineNum">     158 </span>            :         mutable bool     dumped_; // true only after call to str() or &lt;&lt;
<span class="lineNum">     159 </span>            :         string_type      prefix_; // piece of string to insert before first item
<span class="lineNum">     160 </span>            :         unsigned char exceptions_;
<span class="lineNum">     161 </span>            :         internal_streambuf_t   buf_; // the internal stream buffer.
<span class="lineNum">     162 </span>            :         boost::optional&lt;io::detail::locale_t&gt;     loc_;
<span class="lineNum">     163 </span>            :     }; // class basic_format
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span>            : } // namespace boost
<span class="lineNum">     166 </span>            : 
<span class="lineNum">     167 </span>            : 
<span class="lineNum">     168 </span>            : #endif // BOOST_FORMAT_CLASS_HPP
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
